'''
Reschedule test
'''

from interactive import *

#1)

css("#ColonyView")
linkpart("EPO").click()
twait()

css("#ColonyMenu")
linkpart("Reschedule").click()
twait()
alert = driver.switch_to_alert()
assert(alert.text == "Successfully rescheduled.")
alert.accept()

linkpart("Experiments").click()
twait()

linkpart("Alpha").click()
twait()

linkpart("Alpha 1").click()
twait()

#fully scheduled this experiment group
assert(len(driver.find_elements_by_css_selector("#InterventionList li")) == 5)

Back()

linkpart("Alpha 2").click()
twait()

assert(len(driver.find_elements_by_css_selector("#InterventionList li")) == 5)

Back()
Back()

linkpart("Beta").click()
twait()

linkpart("Beta 1").click()
twait()

#no mice scheduled for this group
assert(len(driver.find_elements_by_css_selector("#InterventionList li")) == 0)

Back()

linkpart("Beta 2").click()
twait()

assert(len(driver.find_elements_by_css_selector("#InterventionList li")) == 5)

Back()
Back()

linkpart("Charlie").click()
twait()

linkpart("Charlie 1").click()
twait()

assert(len(driver.find_elements_by_css_selector("#InterventionList li")) == 5)

driver.quit()
